﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using fsw.Common;
using System.Data;

namespace fsw.BLL
{
    public partial class Admin_Pic
    {
        private readonly DAL.Admin_Pic dal;
        public Admin_Pic()
        {
            dal = new DAL.Admin_Pic(DTKeys.DATA_BASE_PREFIX);
        }
        #region=====基本操作====
        /// <summary>
        /// 根据id判读是否存在
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool Exists(int id)
        {
            return dal.Exists(id);
        }
         /// <summary>
        /// 添加数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Add(Model.Admin_Pic model)
        {
            return dal.Add(model);
        }
        /// <summary>
        /// 更新数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Update(Model.Admin_Pic model)
        {
            return dal.Update(model);
        }
        /// <summary>
        /// 更新数据
        /// </summary>
        /// <param name="id"></param>
        /// <param name="strValue"></param>
        /// <returns></returns>
        public bool UpdateField(int id, string strValue)
        {
            return dal.UpdateField(id, strValue);
        }
        /// <summary>
        /// 删除一条数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool Delete(int id)
        {
            return dal.Delete(id);
        }
        /// <summary>
        /// 得到一个实体
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Model.Admin_Pic GetModel(int id)
        {
            return dal.GetModel(id);
        }
        /// <summary>
        /// 图片复制次数
        /// </summary>
        /// <param name="PicPath"></param>
        /// <param name="PicName"></param>
        /// <returns></returns>
        public string GetCount(string PicPath, string PicName)
        {
            return dal.GetCount(PicPath, PicName);
        }
        /// <summary>
        /// 图片复制查看次数
        /// </summary>
        /// <param name="PicPath"></param>
        /// <param name="PicName"></param>
        /// <param name="TypeId"></param>
        /// <returns></returns>
        public string GetCount(string PicPath, string PicName, int TypeId)
        {
            return dal.GetCount(PicPath, PicName, TypeId);
        }
        /// <summary>
        /// 图片查看复制次数
        /// </summary>
        /// <param name="PicPath"></param>
        /// <param name="PicName"></param>
        /// <returns></returns>
        public string GetTypeidCount(string PicPath, string PicName)
        {
            return dal.GetTypeidCount(PicPath, PicName);
        }
        /// <summary>
        /// 查询查看,复制次数,左工号,右非工号
        /// </summary>
        /// <param name="PicPath"></param>
        /// <param name="PicName"></param>
        /// <returns></returns>
        public string Get_TypeId_Count(string PicPath, string PicName)
        {
            return dal.Get_TypeId_Count(PicPath, PicName);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<Model.Admin_Pic> GetList(string strWhere, string filedOrder)
        {
            return dal.GetList(strWhere, filedOrder);
        }
        /// <summary>
        /// 查询所有索引
        /// </summary>
        /// <param name="strWhere"></param>
        /// <param name="filedOrder"></param>
        /// <returns></returns>
        public DataTable GetListTable(string strWhere, string filedOrder)
        {
            return dal.GetListTable(strWhere, filedOrder);
        }
        /// <summary>
        /// 分页数据
        /// </summary>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <param name="strWhere"></param>
        /// <param name="filedOrder"></param>
        /// <param name="recordCount"></param>
        /// <returns></returns>
        public DataSet GetList(int pageSize, int pageIndex, string strWhere, string filedOrder, out int recordCount)
        {
            return dal.GetList(pageSize, pageIndex, strWhere, filedOrder, out recordCount);
        }
        /// <summary>
        /// 分页数据
        /// </summary>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <param name="strWhere"></param>
        /// <param name="filedOrder"></param>
        /// <param name="recordCount"></param>
        /// <returns></returns>
        public DataSet GetListStr(int pageSize, int pageIndex, string strWhere, string filedOrder, out int recordCount)
        {
            return dal.GetListStr(pageSize, pageIndex, strWhere, filedOrder, out recordCount);
        }
        /// <summary>
        /// 分页数据
        /// </summary>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <param name="strWhere"></param>
        /// <param name="filedOrder"></param>
        /// <param name="recordCount"></param>
        /// <returns></returns>
        public List<Model.Admin_Pic> GetPicList(int pageSize, int pageIndex, string strWhere, string filedOrder, out int recordCount)
        {
            return dal.GetPicList(pageSize, pageIndex, strWhere, filedOrder, out recordCount);
        }
        #endregion
    }
}
